﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;
using SharedGenomics.Workbench.Views;
using SharedGenomics.Annotations;

namespace SharedGenomics.Workbench.Presenters
{
    public class GeneSummaryPresenter : AnnotationPresenter<GeneSummaryAnnotation>
    {
        public GeneSummaryPresenter(IGeneSummaryView view)
            : base(view)
        {
            this.SummaryView = view;
        }

        protected override void OnAnnotationSet(GeneSummaryAnnotation annotation)
        {
            annotation.ThrowIfNull("annotation");
            annotation.Gene.ThrowIfNull<ArgumentException>("Cannot display annotation - Gene is null");

            this.SummaryView.Gene = annotation.Gene;
        }

        private IGeneSummaryView SummaryView { get; set; }
    }
}
